Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create 0280-wiggle-sort.java #3717

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dmgodoy
Copy link

@dmgodoy dmgodoy commented Nov 4, 2024

Important

Please make sure the file name is lowercase and a duplicate file does not already exist before merging.

Comment on lines 3 to 5
for(int i = 1; i < nums.length; i++){
if((i % 2 == 0 && nums[i] > nums[i - 1])
|| (i % 2 == 1 && nums[i] < nums[i - 1]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to have a space after control flow statements. There should also be an additional space between the for loop and the opening bracket

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added spacing before the control flow statements

java/0280-wiggle-sort.java Outdated Show resolved Hide resolved
@Ykhan799
Copy link
Collaborator

Ykhan799 commented Nov 5, 2024

@dmgodoy Solution looks good. Please address my comments regarding spacing. The spaces will help improve readability of your code

@dmgodoy
Copy link
Author

dmgodoy commented Nov 5, 2024

Thanks for the feedback. I have just updated the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants